const {
  request
} = require('../utils/request.js')

// 立即预约
exports.appointment = function (data, opts) {
  return request.post('/system/apps', data, opts)
}

// 验房师登录
exports.inspectorLogin = function (data, opts) {
  return request.get('/auth/apps/login', data, opts)
}

// 验房师退出登录
exports.inspectorLogout = function (data, opts) {
  return request.delete('/auth/logout', data, opts)
}

// 加入验房师
exports.joinUs = function (data, opts) {
  return request.post('/system/apps/joinUs', data, opts)
}

// 获取地址和客服信息
exports.getCity = function (data, opts) {
  return request.get('/system/apps/getCity', data, opts)
}

// 用户报告下载
exports.getUserReport = function (data, opts) {
  return request.get('/system/report/user/download', data, opts)
}

//获取验收模版
exports.getReportTemplate = function (data, opts) {
  return request.get('/system/apps/fangModel', data, opts)
}

// 报告管理列表
exports.fetchReportList = function (data, opts) {
  return request.get('/system/report/select/list', data, opts)
}

// 支付定金
exports.wxPayment = function (data, opts) {
  return request.post('/system/WxPayment/new1/pre-book', data, opts)
}

// uploadByBase64
exports.uploadFileByBase64 = function (data, opts) {
  return request.post('/file/upload/base64', data, opts)
}

// 填写验房报告，生成pdf
exports.genReport = function (data, opts) {
  return request.post('/system/report', data, opts)
}

// 修改报告,重新生成pdf
exports.modifyReport = function (data, opts) {
  return request.put('/system/report', data, opts)
}

exports.getOpenId = function (data, opts) {
  return request.get(`/system/WxPayment/openid1/${data.code}`, data, opts)
}

// 报告下载
exports.getReportDownload = function (data, opts) {
  return request.get(`/system/report/download/${data.id}`, data, opts)
}

// 客服登录
exports.customerLogin = function (data, opts) {
  return request.post('/auth/login/customer', data, opts)
}

// 未完成
exports.getUncompleteOrders = function (data, opts) {
  return request.get('/system/customer/Incomplete', data, opts)
}

// 已完成
exports.getCompleteOrders = function (data, opts) {
  return request.get('/system/customer/Completed', data, opts)
}

// 添加备注
exports.addRemark = function (data, opts) {
  return request.post('/system/customer/AddRemarks', data, opts)
}

// 修改订单状态
exports.modifyOrder = function (data, opts) {
  return request.post('/system/customer/Modify', data, opts)
}
//获取用户访问次数
exports.getCustmorClick = function (data, opts) {
  return request.get('/system/user/click/click/${data.openId}', data, opts)
}